<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>字符转数值</title>
</head>

<body>

</body>
<script>
    var str = "1000";
    console.log(parseInt(str,2));
    var str1 ="123.500";
    console.log(parseFloat(str1));
    console.log(Number(str));
    console.log(Math.round(str1));
    var num = 123;
    console.log(num.toString());
    var num1 = 123.234455;
    console.log(num1.toString());
    console.log(num1.toFixed(2));
</script>

</html>